package com.lihao.sam.controller;

import com.lihao.sam.entity.HouseBasicSetting;
import com.lihao.sam.entity.HouseResourceSetting;
import com.lihao.sam.service.intf.HouseBasicSettingService;
import com.lihao.sam.service.intf.HouseResourceSettingService;
import com.lihao.sam.vo.PageVo;
import com.lihao.sam.vo.R;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import javax.servlet.http.HttpSession;

/**
 * @ClassName HouseResourceSettingController
 * @Description TODO
 * @Author LiHao
 * @Date 2022/11/23 9:16
 * @Version 1.0
 */
@RestController
@RequestMapping("/api/resourcesetting/")
public class HouseResourceSettingController {
    @Resource
    private HouseResourceSettingService service;

    @PostMapping("add.do")
    public R add(HouseResourceSetting resourceSetting) {
        return service.add(resourceSetting);
    }

    @PostMapping("update.do")
    public R update(HouseResourceSetting resourceSetting) {
        return service.update(resourceSetting);
    }

    @PostMapping("delete.do")
    public R delete(int id, HttpSession session) {
        return service.delete(id);
    }

    @GetMapping("page.do")
    public PageVo page(int page, int limit, String address, Integer buildingNo, Integer floorNo) {
        return service.queryPage(page, limit, address, buildingNo, floorNo);
    }
    @PostMapping("deletebatch.do")
    public R deleteBatch(int[] ids) {
        return service.deleteBatch(ids);
    }
}
